(SST) ShlWAPI.pas Version 1.08

Developer Reference
(SST)ShlWAPI ColorHLSToRGB Function
Returns the red, green, and blue values corresponding to the specified color's hue, luminance, and saturation.
Scope
Global (i.e. this function can be called/accessed from code in any unit that includes/uses (SST)ShlWAPI.pas).
Syntax
function ColorHLSToRGB(wHue : WORD; wLuminance : WORD; wSaturation : WORD) : COLORREF;  
Parameters
wHue [in] A 16 bit, word value defining the hue of the color for which to return the red, green, and blue (RGB) values.
wLuminance [in] A 16 bit, word value defining the Luminance of the color for which to return the red, green, and blue (RGB) values.
wSaturation [in] A 16 bit, word value defining the saturation of the color for which to return the red, green, and blue (RGB) values.
Return Values
Returns a COLORREF value which contains the red, green, and blue values corresponding to the hue, luminance, and saturation (HLS) input values.
Example
PROCEDURE TForm4.TestShlWAPIColorHLSToRGB(Sender : TObject); VAR hue : WORD; //the H of the HLS VAR luminance : WORD; //the L of the HLS VAR saturation : WORD; //the S of the HLS VAR rgbcolor : COLORREF; VAR alpha : BYTE; VAR red : BYTE; VAR green : BYTE; VAR blue : BYTE; VAR newinfoline : STRING; BEGIN hue := 0; luminance := 0; saturation := 0; rgbcolor := 0; alpha := 0; red := 0; green := 0; blue := 0; newinfoline := ''; hue := 221; luminance := 88; saturation := 54; rgbcolor := ColorHLSToRGB(hue, luminance, saturation); newinfoline := 'ColorHLSToRGB called with a hue (H) value of 0x' + IntToHex(hue, 4) + ' (' + IntToStr(hue) + '), ' + 'luminance (L) of 0x' + IntToHex(luminance, 4) + ' (' + IntToStr(luminance) + '), ' + 'saturation (S) of 0x' + IntToHex(saturation, 4) + ' (' + IntToStr(saturation) + '), '; Memo1.Lines.Add(newinfoline); alpha := HIBYTE(HIWORD(rgbcolor)); red := LOBYTE(HIWORD(rgbcolor)); green := HIBYTE(LOWORD(rgbcolor)); blue := LOBYTE(LOWORD(rgbcolor)); newinfoline := 'returned a red (R), green (G), blue (B) value of : 0x' + IntToHex(rgbcolor, 8) + ' (' + IntToStr(red) + ', ' + IntToStr(green) + ', ' + IntToStr(blue) + ')'; Memo1.Lines.Add(newinfoline); Memo1.Lines.Add(''); END;
The above example will produce the following output:
ColorHLSToRGB called with a hue (H) value of 0x00DD (221), luminance (L) of 0x0058 (88), saturation (S) of 0x0036 (54), returned a red (R), green (G), blue (B) value of : 0x005C4873 (92, 72, 115)
Requirements
Unit: Declared and imported in (SST)ShlWAPI.pas
Library: (SST)ShlWAPI.dcu/(SST)ShlWAPI.obj
Unicode: Not applicable.
Min. ShlWAPI.dll version according to MS SDK doc.: 5.0
Min. ShlWAPI.dll version based on SST research: 5.0
Min. OS version(s) according to Microsoft SDK doc.: Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5
Min. OS version(s) according to SST research.: Windows NT 4.0 with IE 5, Windows 95 with IE 5, Windows 98 with IE 5, Windows 98 SE,Windows 2000 and later
See Also
ColorAdjustLuma, ColorRGBToHLS, SHCreateShellPalette, SHGetInverseCMAP
 
Windows APIs: ColorAdjustLuma, ColorHLSToRGB, ColorRGBToHLS, SHCreateShellPalette, SHGetInverseCMAP,


Document/Contents version 1.00
Page/URI last updated on 07.12.2023
 
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to:
webmaster@stoelzelsoftwaretech.com